package  
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	/**
	 * ...
	 * @author Seven Gae
	 */
	public class YouWin extends Level_Base 
	{
		
		private var background: FlashingBackground;
		private var youWin: MovieClip;
		private var logoSeven: MovieClip;
		
		public override function start():void
		{	
			background = new FlashingBackground();
			
			youWin = new Win();
			youWin.y = - 170;
			Main.Self.screen.addChild(youWin);
			Main.Self.stage.addEventListener(MouseEvent.CLICK, handleTryAgain);
			
			logoSeven = new LogoSeven()
			logoSeven.x = Main.Self.stage.stageWidth - logoSeven.width + 130;
			logoSeven.y = Main.Self.stage.stageHeight - logoSeven.height + 50;
			Main.Self.screen.addChild(logoSeven);
			
			SoundManager.playSound("victory");
		}
		
		public function handleTryAgain(Evento:MouseEvent):void
		{
			Main.Self.stage.removeEventListener(MouseEvent.CLICK, handleTryAgain);
			Main.Self.screen.removeChild(youWin);
			LevelManager.current = new Level1();
			
		}
		
		public override function update():void
		{	
			background.update();
		}
		
		public override function terminate():void
		{
			background.destroy();
			Main.Self.screen.removeChild(logoSeven);
		}
		
	}

}